package com.perceptivesoftware.licensing.client.rpc;

import java.util.List;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.perceptivesoftware.licensing.client.common.util.PerceptivePermission;
import com.perceptivesoftware.licensing.client.dialogs.useradmin.plugin.role.RoleDTO;
import com.perceptivesoftware.licensing.client.dialogs.useradmin.plugin.role.RoleNavItem;
import com.perceptivesoftware.licensing.client.dialogs.useradmin.plugin.user.PermissionsSaveDTO;
import com.perceptivesoftware.licensing.client.dialogs.useradmin.plugin.user.UserDTO;
import com.perceptivesoftware.licensing.client.dialogs.useradmin.plugin.user.UserNavItem;
import com.perceptivesoftware.licensing.client.dto.SecurityTreeDTO;

@RemoteServiceRelativePath("../rpc/securityService")
public interface SecurityService extends RemoteService {

	public RoleNavItem createRole(String name);

	public UserNavItem createUser(String name, String roleCode, Boolean isSuper);

	public String deleteRole(String userCode);

	public String deleteUser(String userCode);

	public RoleDTO getRoleDTO(String roleCode);

	public UserDTO getUserDTO(String userCode);

	public String renameRole(String roleCode, String name);
	
	public UserDTO saveUserSettings(UserDTO user);

	public PermissionsSaveDTO saveUserPermissions(String userCode, List<PerceptivePermission> dirtyPermissions);

	public PermissionsSaveDTO saveRolePermissions(String roleCode, List<PerceptivePermission> dirtyPermissions);

	public PermissionsSaveDTO saveRolePermissions(String roleCode, List<PerceptivePermission> dirtyPermissions, List<PerceptivePermission> cascadePermissions);

	public void saveUserConfig(String userCode, UserDTO userDTO);

	public SecurityTreeDTO getSecurityTreeDTO(String roleValCode);
}